package com.fili.gui.sources;

import com.fili.gui.sources.LineNumbers;
import com.fili.core.sources.MappedSource;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Nov 17, 2006
 * Time: 1:08:59 PM
 * Revision: 0
 */
public class SourceView extends JComponent
{
    private SourcePane pane;
    private JScrollPane scrollPane;

    public SourceView()
    {
        setLayout(new BorderLayout());
        pane = new SourcePane();

        scrollPane = new JScrollPane(pane);
        add(scrollPane, BorderLayout.CENTER);

        LineNumbers lines = new LineNumbers(pane, scrollPane);
        add(lines, BorderLayout.WEST);
    }

    public void setSource(MappedSource src)
    {
        pane.setSource(src);
    }
}
